package com.example.lostandfoundsystem.services.system;

import com.example.lostandfoundsystem.models.system.User;
import gaarason.database.contract.eloquent.Record;
import org.springframework.stereotype.Service;

/**
 * @author lucifer
 * @since 2024-07-21-17:28
 */
@Service
public class UserService {

    private static User.Model userModel;

    // 通过学号查询User用户
    public static User getUserData(String number) {
        Record<User, Long> record = userModel.newQuery().where(User::getNumber, number).first();
        if (record != null) {
            return record.getEntity();
        } else {
            return null;
        }
    }
}
